import { exportRequest } from '#/utils/request.js';
import request from '#/utils/requestAbort.js';
// 交易单元
export async function getStationLevelThree(params: { menuCode?: string }) {
  return request('/generation-common/correlaNodeStationConfig/queryMarketList', {
    method: 'POST',
    data: params,
  });
}

// 合约类型
export async function getContractTypeCodes(params = {}) {
  return request('/disclosure/provinceContractType/getProvinceContractType', {
    method: 'POST',
    data: params,
  });
}

// 获取合约列表
export async function postContractList(params: any) {
  return request('/disclosure/contract-manage/contractList', {
    method: 'POST',
    data: params,
  });
}

// 获取新疆的合约列表
export async function getXinjiangContractList(params: any) {
  return request('/disclosure/xinjiangContractManage/list', {
    method: 'POST',
    data: params,
  });
}

// 删除新疆合约
export async function deleteXinjiangContract(params: any) {
  return request('/disclosure/xinjiangContractManage/deleteContract', {
    method: 'POST',
    data: params,
  });
}

// 导出新疆合约
export async function exportXinjiangContract(params: any) {
  return exportRequest('/disclosure/xinjiangContractManage/contractExport', {
    method: 'POST',
    data: params,
  });
}

// 删除合约
export async function postContractDel(params: any) {
  return request('/disclosure/contract-manage/contractDel', {
    method: 'POST',
    data: params,
  });
}

// 获取合约详情
export async function postContractDetail(params: any) {
  return request('/disclosure/contract-manage/contractDetail', {
    method: 'POST',
    data: params,
  });
}

// 获取合约量价信息
export async function postCsontractPriceFluctuation(params: any) {
  return request('/disclosure/contract-manage/contractPriceFluctuation', {
    method: 'POST',
    data: params,
  });
}

// 获取交易类型
export async function getTradeType() {
  return request(`/disclosure/contract-manage/tradeType`, {
    method: 'GET',
  });
}

// 获取关联合约列表
export async function getStationRelatedHisContract(params: any) {
  return request(`/disclosure/contract-manage/stationRelatedHisContract/${params?.stationId}`, {
    method: 'GET',
  });
}

// 查询交易对手信息
export async function getContractDel(params: any) {
  return request('/disclosure/counterparty/getCounterPartyList', {
    method: 'POST',
    data: params,
  });
}

// 新增交易对手
export async function postAddCounterParty(params: any) {
  return request('/disclosure/counterparty/addCounterParty', {
    method: 'POST',
    data: params,
  });
}

//获取交易序列
export async function getStationRelatedTradeNotice(params: any) {
  return request(`/disclosure/trade-notice/stationRelatedTradeNotice/${params?.stationId}`, {
    method: 'GET',
  });
}

// 交易模版获取
export async function getTemplate() {
  return request('/disclosure/contract-manage/template', {
    method: 'GET',
  });
}

// 新建/编辑合约
export async function postContractEdit(params: any) {
  return request('/disclosure/contract-manage/contractEdit', {
    method: 'POST',
    data: params,
  });
}

// 导出合约
export async function postQuantityPriceExport(params: any) {
  return request('/disclosure/contract-manage/quantityPriceExport', {
    method: 'POST',
    data: params,
    responseType: 'blob',
    getResponse: true,
  });
}

// 新疆 合约详情
export async function postXJContractDetail(params: any) {
  return request('/disclosure/xinjiangContractManage/contractDetails', {
    method: 'POST',
    data: params,
  });
}
// 新疆 新建合约
export async function postXJContractCreate(params: any) {
  return request('/disclosure/xinjiangContractManage/newContract', {
    method: 'POST',
    data: params,
  });
}
// 新疆 编辑合约
export async function postXJContractEdit(params: any) {
  return request('/disclosure/xinjiangContractManage/editContract', {
    method: 'POST',
    data: params,
  });
}
//导入合约
export async function postInsertContract(params: any) {
  return request('/disclosure/xinjiangContractManage/insertContract', {
    method: 'POST',
    data: params,
  });
}
// // 合计 获取合约详情
// export async function postMonthTotal(params: any) {
//   return request('/fanrun/contract-manage/getContractManageMonthTotal', {
//     method: 'POST',
//     data: params,
//   });
// }
// // 合计  获取合约量价信息
// export async function postOneDayTotal(params: any) {
//   return request('/fanrun/contract-manage/getContractManageOneDayTotal', {
//     method: 'POST',
//     data: params,
//   });
// }
